
package com.example.gokuplayalong.bases.beans;

import androidx.annotation.NonNull;

import com.alibaba.fastjson.JSONObject;
import com.example.gokuplayalong.bases.exception.ExceptionUtils;

public class Beans implements Cloneable {
    JSONObject jsonObject = new JSONObject();

    public JSONObject getJsonObject() {
        return jsonObject;
    }

    public void setJsonObject(JSONObject jsonObject) {
        this.jsonObject = jsonObject;
    }

    @NonNull
    @Override
    public Object clone() {
        try {
            Beans beans = (Beans) super.clone();
            beans.jsonObject = (JSONObject) jsonObject.clone();
            return beans;
        } catch (Throwable throwable) {
            ExceptionUtils.getException(ExceptionUtils.getTraceInfo(), throwable);
            return new Beans();
        }
    }

    public boolean isEmpty() {
        return jsonObject.isEmpty();
    }

    @NonNull
    @Override
    public String toString() {
        return jsonObject.toString();
    }
}
